unit DesignTimeForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IniFiles;

type
  TForm2 = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label01: TLabel;
    Label02: TLabel;
    Label03: TLabel;
    Label04: TLabel;
    Label05: TLabel;
    Label06: TLabel;
    Label11: TLabel;
    Label10: TLabel;
    LabelTotal: TLabel;
    LabelInvalid: TLabel;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.FormCreate(Sender: TObject);
var
  Ini: TIniFile;
  TotalCount: Integer;
begin
  Ini := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'config.ini');
  TotalCount := Ini.ReadInteger('COUNTERS', 'Total', 100);
  if (TotalCount <> 0) then
  begin
    Label01.Caption := FloatToStr(Trunc(Ini.ReadInteger('COUNTERS', '1',
          100) / TotalCount * 100)) + '%';
    Label02.Caption := FloatToStr(Trunc(Ini.ReadInteger('COUNTERS', '2',
          100) / TotalCount * 100)) + '%';
    Label03.Caption := FloatToStr(Trunc(Ini.ReadInteger('COUNTERS', '3',
          100) / TotalCount * 100)) + '%';
    Label04.Caption := FloatToStr(Trunc(Ini.ReadInteger('COUNTERS', '4',
          100) / TotalCount * 100)) + '%';
    Label05.Caption := FloatToStr(Trunc(Ini.ReadInteger('COUNTERS', '5',
          100) / TotalCount * 100)) + '%';
    Label06.Caption := FloatToStr(Trunc(Ini.ReadInteger('COUNTERS', '6',
          100) / TotalCount * 100)) + '%';
  end;
  LabelTotal.Caption := IntToStr(TotalCount);
  LabelInvalid.Caption := IntToStr(Ini.ReadInteger('COUNTERS', 'Invalid', 100));
end;

end.
